﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NORM.SQLObject;

namespace NORM.Test
{
    public partial class 附加测试 : Form
    {
        public 附加测试()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string connectionString = string.Empty;
            connectionString = "Data Source=fasdb.db;Version=3;Password=4HxbajmTkLY=;UseUTF16Encoding=True;";

            try
            {
                var db = NORM.DataBase.DataBaseFactory.Create(connectionString, DataBase.DataBaseTypes.SqliteDataBase);

                Models.T_Category model = new Models.T_Category();
                OQL oql = new OQL(model).Select().End;
                DataTable dt = db.QueryTable(oql);

                dataGridView1.DataSource = dt.DefaultView;

                var obj = db.GetDataBaseObject("t");

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

           
        }
    }
}
